Morning Session Exercises

Afternoon Session Exercises

Look through the paper to get an idea of what this network represents. What do the nodes and edges represent?

The nodes represent characters of the GoT saga. The edges maybe represent the number of times the characters have interacted with each other. These edges represent the relationships between characters.

Look at the data in RStudio using the ‘View’ function. This matrix encodes a network. Can you figure out how? What do the rows stand for and what do the columns stand for?

The rows stand for the character pairings relationship strength. The columns stand for character 1, character 2, interaction strength.

When plotting an undirected graph using an adjacency or weights matrix as input I normally do not have to set the directed argument? Now that I use an edgelist, however, I do. Why?

We use the directed = FALSE argument because ?

Recreate the plot above, changing the layout to a spring layout, the edge color to ‘“darkblue”‘ and the node size to 3. Look at the qgraph help page to figure out the commands needed (?qgraph). Note: your computer might generate a different spring layout (nodes placed on different locations).

What values did qgraph set to cut and maximum? Note: minimum is always set to 0 by default and not shown with details = TRUE unless it differs from 0.

The cut value defaults to 0 for graphs with less then 20 nodes. For larger graphs the cut value is automatically chosen to be equal to the maximum of the 75th quantile of absolute edge strengths or the edge strength corresponding to 2n-th edge strength (n being the number of nodes). In this case it equals 14.

qgraph regards the highest of the maximum or highest absolute edge weight as the highest weight to scale the edge widths too. To compare several graphs, set this argument to a higher value than any edge weight in the graphs (typically 1 for correlations). In this case it equals 96.

Set the minimum argument to 1, 5 and 10 while using a spring layout. How does the network change? Do the same using the threshold argument. Can you explain why the layout remains the same using minimum but changes using threshold?

The plots with the different minimum values are shown below:

The plots with the different cutoff values are shown below:

The layout remains the same using minimum because edges with absolute weights under that value are not shown (but not omitted). The layout differ using threshold because edges with absolute weight that are not above this value are removed from the network. This differs from minimum which simply changes the scaling of width and color so that edges with absolute weight under minimum are not plotted. Setting a threshold influences the spring layout and centrality measures obtained with the graph whereass setting a minimum does not.

Only by looking at the above picture, can you derive: (i) The degree-centrality of Paris? (ii) The shortest path length between Milan and New York, and how many paths there are of this length? (iii) Of all shortest paths between all pairs of nodes, how many go through Santiago?